package com.wang.di.web.bean;

import com.wang.di.core.bean.BaseBean;
import com.wang.di.core.exception.BeanInitException;
import com.wang.di.web.anno.Controller;

public class ControllerBean extends BaseBean {

    public Object instance = null;

    public ControllerBean(Class clz, Controller anno) {
        super(clz, anno);
        try {
            this.instance = this.create();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public boolean check(Object... cond) {
        return false;
    }

    @Override
    public Object get() throws BeanInitException {
        if (instance == null) {
            this.instance = this.create();
        }
        return instance;
    }

}
